package com.zimmur.platform.common.utils;

import java.util.HashMap;
/**
 * 接口返回结果
 * @Description
 * @author zcx
 * @time 2017年11月15日 下午5:19:14
 */
public class ReturnJsonEntity {	
	private String code;
	private String msg;
	private Object data;
	private String errorMsg="";
	
	public ReturnJsonEntity(){
		this.code="";
		this.msg="";
	}
	public void init(StatusCode codeEnum){
		this.setCode(codeEnum.getCode());
		this.setMsg(codeEnum.getMsg());
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Object getData() {
		return data==null?new HashMap():data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	public String getErrorMsg() {
		return errorMsg;
	}
	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}
	
	@Override
	public String toString() {
		return "ReturnJsonEntity [code=" + code + ", msg=" + msg + ", data=" + data + "]";
	}	
		
}
